<?php
//
//	nc_get_cp_css_directory
//
//	Generate code for css include for the control panel..
//
function nc_get_cp_css_directory ()
{
	echo nc_get_cms_path_relative().'/system/css/cp.css'; 
}
//
//	nc_get_cp
//
//	Generate code for the editor panel. Will only run if $login_state is true (the user is logged in).
//
function nc_get_cp ()
{
	global $nc_login_state, $nc_page_title, $nc_language;

	if($nc_login_state)
	{
		$nc_out = '
		<div class="nc_cp">
			<div class="nc_logo">v'.NC_VERSION.'</div>
			<span class="nc_button nc_button_push_right"><a href="'.nc_get_cms_path_relative().'/index.php?action=logout"><span class="nc_icon nc_icon_logout">Log Out</span></a></span>';
			if($nc_page_title != '') 
				$nc_out .= ' <span class="nc_button nc_button_push_right"><a href="'.nc_get_cms_path_relative().'/index.php?action=edit_string&amp;name='.$nc_page_title.'"><span class="nc_icon nc_icon_title">Edit Page Title</span></a></span>';
		$nc_out .= '
			<div class="clear"></div>
		</div>
		';
		
		echo($nc_out);
	}
}
//
//	nc_content_string
//
//	Generate code for a string area. The string area's unique identifier is passed to $name.
//
function nc_content_string ($name)
{
	global $nc_login_state;
	
	echo(nc_load_create_content ($name)); // Output the content we have prepared to webpage
	
	if($nc_login_state) // Edit mode is on, load the editor
		echo '<a href="'.nc_get_cms_path_relative().'/index.php?action=edit_string&amp;name='.$name.'" class="nc_edit"><img src="'.nc_get_cms_path_relative().'/system/images/edit.png" alt="Log In" title="Log In" border="0"/></a>';
}
//
//	nc_content_html
//
//	Generate code for an html area. The html area's unique identifier is passed to $name.
//
function nc_content_html ($name)
{
	global $nc_login_state;
	
	echo(nc_load_create_content ($name)); // Output the content we have prepared to webpage
	
	if($nc_login_state) // Edit mode is on, load the editor
		echo '<a href="'.nc_get_cms_path_relative().'/index.php?action=edit_html&amp;name='.$name.'" class="nc_edit"><img src="'.nc_get_cms_path_relative().'/system/images/edit.png" alt="Log In" title="Log In" border="0"/></a>';
}
//
//	nc_title
//
//	Generate code for the page title.
//
function nc_title ($name)
{
	global $nc_page_title;
	
	$nc_page_title = $name;
	echo(nc_load_create_content ($name)); // Output the content we have prepared to webpage
}
//
//	nc_login_link
//
//	Generate code for a nice little log in link.
//
function nc_login_link ()
{
	echo '<a href="'.nc_get_cms_path_relative().'" class="nc_login_link"><img src="'.nc_get_cms_path_relative().'/system/images/key.png" alt="Log In" title="Log In" border="0"/></a>';
}